<?php
class TestMailer extends Action {
	/* (non-PHPdoc)
	 * @see Action::execute()
	 */
	public function execute($params) {
		$me = check_login ( ADMIN_LOGIN_PAGE );
		$message = "亲爱的网站管理员：\n\t这是一封测试邮件，如果你能收到，则说明你网站中邮件配置是正确的。";
		$email = rqst ( 'email' );
		
		$rst = sendmail ( $email, "恭喜,你网站的邮件配置通过", $message, null, 'text' );
		if ($rst) {
			$data ['msg'] = '邮件已经发出,请查收.';
		} else {
			$data ['msg'] = '邮件发送失败,详情请查看error.log';
		}
		return new JsonView ( $data );
	}
}